#!/bin/bash

BIN_PATH="/home/$(whoami)/.local/bin/"
ICN_PATH="/home/$(whoami)/.local/share/icons/"
DSK_PATH="/home/$(whoami)/.local/share/applications/"

if [ ! -d ${BIN_PATH} ]; then
    mkdir ${BIN_PATH}
fi

if [ ! -d ${ICN_PATH} ]; then
    mkdir ${ICN_PATH}
fi

if [ ! -d ${DSK_PATH} ]; then
    mkdir ${DSK_PATH}
fi

echo ""
echo "================================================================="
echo "copy qmtv into ${BIN_PATH}"
cp temp_vacuum_viewer.py qmtv
chmod +x qmtv
cp qmtv ${BIN_PATH}/qmtv

echo "copy share/qmtv.png into ${ICN_PAGTH}"
cp share/qmtv.png ${ICN_PATH}/qmtv.png

echo "copy qmtv.desktop into ${DSK_PATH}"
sed "s/USERNAME/$(whoami)/g" share/qmtv.desktop > share/.qmtv.desktop
#cp share/qmcc.desktop ${DSK_PATH}
cp share/.qmtv.desktop ${DSK_PATH}/qmtv.desktop

echo ""
echo "> Successfully installed QMTV! <"
echo "================================================================="
